package com.zr.task;

import android.app.Application;
import android.content.Context;
import android.os.Environment;

import com.lurencun.service.autoupdate.AppUpdate;
import com.lurencun.service.autoupdate.AppUpdateService;
import com.zh.baselibrary.base.ScreenAdapter;
import com.zh.baselibrary.constant.BaseConstant;
import com.zh.baselibrary.netutils.HRetrofitNetHelper;
import com.zh.baselibrary.utils.CrashHandler;
import com.zh.baselibrary.utils.MyCrashHandler;
import com.zh.baselibrary.utils.ShareManager;
import com.zh.baselibrary.views.ToastView;
import com.zr.andealib.util.constant.AndeaConstant;


import org.xutils.x;

import java.io.File;

/**
 * @author EnzoChan
 * @create 2019/4/8
 * @desc:
 */
public class TaskApplication extends Application {

    private static Context context;
    @Override
    public void onCreate() {
        super.onCreate();
        context = this;
        HRetrofitNetHelper.isJdb = true;
        x.Ext.init(this);
        ToastView.init(this);
        ScreenAdapter.setup(this);
        AppUpdateService.getAppUpdate(this).callOnResume();
        ScreenAdapter.register(this, 1280, ScreenAdapter.MATCH_BASE_WIDTH, ScreenAdapter.MATCH_UNIT_DP);
        AndeaConstant.CARD_TTY = "/dev/ttyUSB0";
        AndeaConstant.LOCK_TTY = "/dev/ttyS2";
        CrashHandler.getInstance().init(this);
        BaseConstant.canSpeak = ShareManager.getInt(this, BaseConstant.DEVICE_VOICE)==1;

    }

    public static Context getContext() {
        return context;
    }
}
